Micron Document
`:top
The `!Viterbi algorithm`! is a `F33f`_`[dynamic programming`:/page/wikibook/entry.mu`zim=wikipedia_en_all_nopic_2025-08.zim|entry_path=Dynamic_programming]`_`f `F33f`_`[algorithm`:/page/wikibook/entry.mu`zim=wikipedia_en_all_nopic_2025-08.zim|entry_path=Algorithm]`_`f that finds the most likely sequence of hidden events that would explain a sequence of observed events. The result of the algorithm is often called the `!Viterbi path`!. It is most commonly used with `F33f`_`[hidden Markov models`:/page/wikibook/entry.mu`zim=wikipedia_en_all_nopic_2025-08.zim|entry_path=Hidden_Markov_model]`_`f (HMMs). For example, if a doctor observes a patient's symptoms over several days (the observed events), the Viterbi algorithm could determine the most probable sequence of underlying health conditions (the hidden events) that caused those symptoms.

The algorithm has found universal application in decoding the `F33f`_`[convolutional codes`:/page/wikibook/entry.mu`zim=wikipedia_en_all_nopic_2025-08.zim|entry_path=Convolutional_code]`_`f used in both `F33f`_`[CDMA`:/page/wikibook/entry.mu`zim=wikipedia_en_all_nopic_2025-08.zim|entry_path=Code-division_multiple_access]`_`f and `F33f`_`[GSM`:/page/wikibook/entry.mu`zim=wikipedia_en_all_nopic_2025-08.zim|entry_path=GSM]`_`f digital cellular, `F33f`_`[dial-up`:/page/wikibook/entry.mu`zim=wikipedia_en_all_nopic_2025-08.zim|entry_path=Dial-up_Internet_access]`_`f modems, satellite, deep-space communications, and `F33f`_`[802.11`:/page/wikibook/entry.mu`zim=wikipedia_en_all_nopic_2025-08.zim|entry_path=802.11]`_`f wireless LANs. It is also commonly used in `F33f`_`[speech recognition`:/page/wikibook/entry.mu`zim=wikipedia_en_all_nopic_2025-08.zim|entry_path=Speech_recognition]`_`f, `F33f`_`[speech synthesis`:/page/wikibook/entry.mu`zim=wikipedia_en_all_nopic_2025-08.zim|entry_path=Speech_synthesis]`_`f, `F33f`_`[diarization`:/page/wikibook/entry.mu`zim=wikipedia_en_all_nopic_2025-08.zim|entry_path=Speaker_diarisation]`_`f,`:cite-ref-1[`F5bf`_`[1`#cite-note-1]`_`f] `F33f`_`[keyword spotting`:/page/wikibook/entry.mu`zim=wikipedia_en_all_nopic_2025-08.zim|entry_path=Keyword_spotting]`_`f, `F33f`_`[computational linguistics`:/page/wikibook/entry.mu`zim=wikipedia_en_all_nopic_2025-08.zim|entry_path=Computational_linguistics]`_`f, and `F33f`_`[bioinformatics`:/page/wikibook/entry.mu`zim=wikipedia_en_all_nopic_2025-08.zim|entry_path=Bioinformatics]`_`f. For instance, in `F33f`_`[speech-to-text`:/page/wikibook/entry.mu`zim=wikipedia_en_all_nopic_2025-08.zim|entry_path=Speech-to-text]`_`f (speech recognition), the acoustic signal is the observed sequence, and a string of text is the "hidden cause" of that signal. The Viterbi algorithm finds the most likely string of text given the acoustic signal.

>>Contents

• `F0af`_`[History`#history]`_`f
• `F0af`_`[Algorithm`#algorithm]`_`f
• `F0af`_`[Pseudocode`#pseudocode]`_`f
• `F0af`_`[Example`#example]`_`f
• `F0af`_`[Extensions`#extensions]`_`f
• `F0af`_`[Soft output Viterbi algorithm`#soft-output-viterbi-algorithm]`_`f
• `F0af`_`[See also`#see-also]`_`f
• `F0af`_`[References`#references]`_`f
• `F0af`_`[General references`#general-references]`_`f
• `F0af`_`[External links`#external-links]`_`f
• `F0af`_`[Implementations`#implementations]`_`f

-─

>>History

The Viterbi algorithm is named after `F33f`_`[Andrew Viterbi`:/page/wikibook/entry.mu`zim=wikipedia_en_all_nopic_2025-08.zim|entry_path=Andrew_Viterbi]`_`f, who proposed it in 1967 as a decoding algorithm for `F33f`_`[convolutional codes`:/page/wikibook/entry.mu`zim=wikipedia_en_all_nopic_2025-08.zim|entry_path=Convolution_code]`_`f over noisy digital communication links.`:cite-ref-2[`F5bf`_`[2`#cite-note-2]`_`f] It has, however, a history of `F33f`_`[multiple invention`:/page/wikibook/entry.mu`zim=wikipedia_en_all_nopic_2025-08.zim|entry_path=Multiple_invention]`_`f, with at least seven independent discoveries, including those by Viterbi, `F33f`_`[Needleman and Wunsch`:/page/wikibook/entry.mu`zim=wikipedia_en_all_nopic_2025-08.zim|entry_path=Needleman–Wunsch_algorithm]`_`f, and `F33f`_`[Wagner and Fischer`:/page/wikibook/entry.mu`zim=wikipedia_en_all_nopic_2025-08.zim|entry_path=Wagner–Fischer_algorithm]`_`f.`:cite-ref-slp-3-0[`F5bf`_`[3`#cite-note-slp-3]`_`f] It was introduced to `F33f`_`[natural language processing`:/page/wikibook/entry.mu`zim=wikipedia_en_all_nopic_2025-08.zim|entry_path=Natural_language_processing]`_`f as a method of `F33f`_`[part-of-speech tagging`:/page/wikibook/entry.mu`zim=wikipedia_en_all_nopic_2025-08.zim|entry_path=Part-of-speech_tagging]`_`f as early as 1987.

`*Viterbi path`* and `*Viterbi algorithm`* have become standard terms for the application of dynamic programming algorithms to maximization problems involving probabilities.`:cite-ref-slp-3-1[`F5bf`_`[3`#cite-note-slp-3]`_`f] For example, in statistical parsing a dynamic programming algorithm can be used to discover the single most likely context-free derivation (parse) of a string, which is commonly called the "Viterbi parse".`:cite-ref-4[`F5bf`_`[4`#cite-note-4]`_`f]`:cite-ref-5[`F5bf`_`[5`#cite-note-5]`_`f]`:cite-ref-6[`F5bf`_`[6`#cite-note-6]`_`f] Another application is in `F33f`_`[target tracking`:/page/wikibook/entry.mu`zim=wikipedia_en_all_nopic_2025-08.zim|entry_path=Optical_motion_tracking]`_`f, where the track is computed that assigns a maximum likelihood to a sequence of observations.`:cite-ref-7[`F5bf`_`[7`#cite-note-7]`_`f]

>>Algorithm

Given a hidden Markov model with a set of hidden states S {\\displaystyle S} and a sequence of T {\\displaystyle T} observations o 0 , o 1 , … … , o T − − 1 {\\displaystyle o_{0},o_{1},\\dots ,o_{T-1}} , the Viterbi algorithm finds the most likely sequence of states that could have produced those observations. At each time step t {\\displaystyle t} , the algorithm solves the subproblem where only the observations up to o t {\\displaystyle o_{t}} are considered.

Two matrices of size T × × | S | {\\displaystyle T\\times \\left|{S}\\right|} are constructed:

• P t , s {\\displaystyle P_{t,s}} contains the maximum probability of ending up at state s {\\displaystyle s} at observation t {\\displaystyle t} , out of all possible sequences of states leading up to it.
• Q t , s {\\displaystyle Q_{t,s}} tracks the previous state that was used before s {\\displaystyle s} in this maximum probability state sequence.

Let π π s {\\displaystyle \\pi _{s}} and a r , s {\\displaystyle a_{r,s}} be the initial and transition probabilities respectively, and let b s , o {\\displaystyle b_{s,o}} be the probability of observing o {\\displaystyle o} at state s {\\displaystyle s} . Then the values of P {\\displaystyle P} are given by the recurrence relation`:cite-ref-8[`F5bf`_`[8`#cite-note-8]`_`f] P t , s = { π π s ⋅ ⋅ b s , o t if t = 0 , max r ∈ ∈ S ( P t − − 1 , r ⋅ ⋅ a r , s ⋅ ⋅ b s , o t ) if t > 0. {\\displaystyle P_{t,s}={\\begin{cases}\\pi _{s}\\cdot b_{s,o_{t}}&{\\text{if }}t=0,\\\\\\max _{r\\in S}\\left(P_{t-1,r}\\cdot a_{r,s}\\cdot b_{s,o_{t}}\\right)&{\\text{if }}t>0.\\end{cases}}} The formula for Q t , s {\\displaystyle Q_{t,s}} is identical for t > 0 {\\displaystyle t>0} , except that max {\\displaystyle \\max } is replaced with `F33f`_`[arg ⁡ max {\displaystyle \arg \max }`:/page/wikibook/entry.mu`zim=wikipedia_en_all_nopic_2025-08.zim|entry_path=Arg_max]`_`f, and Q 0 , s = 0 {\\displaystyle Q_{0,s}=0} . The Viterbi path can be found by selecting the maximum of P {\\displaystyle P} at the final timestep, and following Q {\\displaystyle Q} in reverse.

>>Pseudocode

`B100`F9d9function Viterbi(states, init, trans, emit, obs) is`f`b
`B100`F9d9 input states: S hidden states`f`b
`B100`F9d9 input init: initial probabilities of each state`f`b
`B100`F9d9 input trans: S × S transition matrix`f`b
`B100`F9d9 input emit: S × O emission matrix`f`b
`B100`F9d9 input obs: sequence of T observations`f`b
`B100`F9d9`f`b
`B100`F9d9 prob ← T × S matrix of zeroes`f`b
`B100`F9d9 prev ← empty T × S matrix`f`b
`B100`F9d9 for each state s in states do`f`b
`B100`F9d9 prob[0][s] = init[s] * emit[s][obs[0]]`f`b
`B100`F9d9`f`b
`B100`F9d9 for t = 1 to T - 1 inclusive do // t = 0 has been dealt with already`f`b
`B100`F9d9 for each state s in states do`f`b
`B100`F9d9 for each state r in states do`f`b
`B100`F9d9 new_prob ← prob[t - 1][r] * trans[r][s] * emit[s][obs[t]]`f`b
`B100`F9d9 if new_prob > prob[t][s] then`f`b
`B100`F9d9 prob[t][s] ← new_prob`f`b
`B100`F9d9 prev[t][s] ← r`f`b
`B100`F9d9`f`b
`B100`F9d9 path ← empty array of length T`f`b
`B100`F9d9 path[T - 1] ← the state s with maximum prob[T - 1][s]`f`b
`B100`F9d9 for t = T - 2 to 0 inclusive do`f`b
`B100`F9d9 path[t] ← prev[t + 1][path[t + 1]]`f`b
`B100`F9d9`f`b
`B100`F9d9 return path`f`b
`B100`F9d9end`f`b

The time complexity of the algorithm is O ( T × × | S | 2 ) {\\displaystyle O(T\\times \\left|{S}\\right|^{2})} . If it is known which state transitions have non-zero probability, an improved bound can be found by iterating over only those r {\\displaystyle r} which link to s {\\displaystyle s} in the inner loop. Then using `F33f`_`[amortized analysis`:/page/wikibook/entry.mu`zim=wikipedia_en_all_nopic_2025-08.zim|entry_path=Amortized_analysis]`_`f one can show that the complexity is O ( T × × ( | S | + | E | ) ) {\\displaystyle O(T\\times (\\left|{S}\\right|+\\left|{E}\\right|))} , where E {\\displaystyle E} is the number of edges in the graph, i.e. the number of non-zero entries in the transition matrix.

>>Example

A doctor wishes to determine whether patients are healthy or have a fever. The only information the doctor can obtain is by asking patients how they feel. The patients may report that they either feel normal, dizzy, or cold.

It is believed that the health condition of the patients operates as a discrete `F33f`_`[Markov chain`:/page/wikibook/entry.mu`zim=wikipedia_en_all_nopic_2025-08.zim|entry_path=Markov_chain]`_`f. There are two states, "healthy" and "fever", but the doctor cannot observe them directly; they are `*hidden`* from the doctor. On each day, the chance that a patient tells the doctor "I feel normal", "I feel cold", or "I feel dizzy", depends only on the patient's health condition on that day.

The `*observations`* (normal, cold, dizzy) along with the `*hidden`* states (healthy, fever) form a hidden Markov model (HMM). From past experience, the probabilities of this model have been estimated as:

`B100`F9d9init = {"Healthy": 0.6, "Fever": 0.4}`f`b
`B100`F9d9trans = {`f`b
`B100`F9d9 "Healthy": {"Healthy": 0.7, "Fever": 0.3},`f`b
`B100`F9d9 "Fever": {"Healthy": 0.4, "Fever": 0.6},`f`b
`B100`F9d9}`f`b
`B100`F9d9emit = {`f`b
`B100`F9d9 "Healthy": {"normal": 0.5, "cold": 0.4, "dizzy": 0.1},`f`b
`B100`F9d9 "Fever": {"normal": 0.1, "cold": 0.3, "dizzy": 0.6},`f`b
`B100`F9d9}`f`b

In this code, `B100`F9d9init`f`b represents the doctor's belief about how likely the patient is to be healthy initially. Note that the particular probability distribution used here is not the equilibrium one, which would be `B100`F9d9{'Healthy': 0.57, 'Fever': 0.43}`f`b according to the transition probabilities. The transition probabilities `B100`F9d9trans`f`b represent the change of health condition in the underlying Markov chain. In this example, a patient who is healthy today has only a 30% chance of having a fever tomorrow. The emission probabilities `B100`F9d9emit`f`b represent how likely each possible observation (normal, cold, or dizzy) is, given the underlying condition (healthy or fever). A patient who is healthy has a 50% chance of feeling normal; one who has a fever has a 60% chance of feeling dizzy.

A particular patient visits three days in a row, and reports feeling normal on the first day, cold on the second day, and dizzy on the third day.

Firstly, the probabilities of being healthy or having a fever on the first day are calculated. The probability that a patient will be healthy on the first day and report feeling normal is 0.6 × × 0.5 = 0.3 {\\displaystyle 0.6\\times 0.5=0.3} . Similarly, the probability that a patient will have a fever on the first day and report feeling normal is 0.4 × × 0.1 = 0.04 {\\displaystyle 0.4\\times 0.1=0.04} .

The probabilities for each of the following days can be calculated from the previous day directly. For example, the highest chance of being healthy on the second day and reporting to be cold, following reporting being normal on the first day, is the maximum of 0.3 × × 0.7 × × 0.4 = 0.084 {\\displaystyle 0.3\\times 0.7\\times 0.4=0.084} and 0.04 × × 0.4 × × 0.4 = 0.0064 {\\displaystyle 0.04\\times 0.4\\times 0.4=0.0064} . This suggests it is more likely that the patient was healthy for both of those days, rather than having a fever and recovering.

The rest of the probabilities are summarised in the following table:

`t
| Day | 1 | 2 | 3 |
|---|---|---|---|
| Observation | Normal | Cold | Dizzy |
| Healthy | 0.3 | 0.084 | 0.00588 |
| Fever | 0.04 | 0.027 | 0.01512 |
`t

From the table, it can be seen that the patient most likely had a fever on the third day. Furthermore, there exists a sequence of states ending on "fever", of which the probability of producing the given observations is 0.01512. This sequence is precisely (healthy, healthy, fever), which can be found be tracing back which states were used when calculating the maxima (which happens to be the best guess from each day but will not always be). In other words, given the observed activities, the patient was most likely to have been healthy on the first day and also on the second day (despite feeling cold that day), and only to have contracted a fever on the third day.

The operation of Viterbi's algorithm can be visualized by means of a `F33f`_`[trellis diagram`:/page/wikibook/entry.mu`zim=wikipedia_en_all_nopic_2025-08.zim|entry_path=Trellis_diagram]`_`f. The Viterbi path is essentially the shortest path through this trellis.

>>Extensions

A generalization of the Viterbi algorithm, termed the `*max-sum algorithm`* (or `*max-product algorithm`*) can be used to find the most likely assignment of all or some subset of `F33f`_`[latent variables`:/page/wikibook/entry.mu`zim=wikipedia_en_all_nopic_2025-08.zim|entry_path=Latent_variable]`_`f in a large number of `F33f`_`[graphical models`:/page/wikibook/entry.mu`zim=wikipedia_en_all_nopic_2025-08.zim|entry_path=Graphical_model]`_`f, e.g. `F33f`_`[Bayesian networks`:/page/wikibook/entry.mu`zim=wikipedia_en_all_nopic_2025-08.zim|entry_path=Bayesian_network]`_`f, `F33f`_`[Markov random fields`:/page/wikibook/entry.mu`zim=wikipedia_en_all_nopic_2025-08.zim|entry_path=Markov_random_field]`_`f and `F33f`_`[conditional random fields`:/page/wikibook/entry.mu`zim=wikipedia_en_all_nopic_2025-08.zim|entry_path=Conditional_random_field]`_`f. The latent variables need, in general, to be connected in a way somewhat similar to a `F33f`_`[hidden Markov model`:/page/wikibook/entry.mu`zim=wikipedia_en_all_nopic_2025-08.zim|entry_path=Hidden_Markov_model]`_`f (HMM), with a limited number of connections between variables and some type of linear structure among the variables. The general algorithm involves `*message passing`* and is substantially similar to the `F33f`_`[belief propagation`:/page/wikibook/entry.mu`zim=wikipedia_en_all_nopic_2025-08.zim|entry_path=Belief_propagation]`_`f algorithm (which is the generalization of the `F33f`_`[forward-backward algorithm`:/page/wikibook/entry.mu`zim=wikipedia_en_all_nopic_2025-08.zim|entry_path=Forward-backward_algorithm]`_`f).

With an algorithm called `F33f`_`[iterative Viterbi decoding`:/page/wikibook/entry.mu`zim=wikipedia_en_all_nopic_2025-08.zim|entry_path=Iterative_Viterbi_decoding]`_`f, one can find the subsequence of an observation that matches best (on average) to a given hidden Markov model. This algorithm is proposed by Qi Wang et al. to deal with `F33f`_`[turbo code`:/page/wikibook/entry.mu`zim=wikipedia_en_all_nopic_2025-08.zim|entry_path=Turbo_code]`_`f.`:cite-ref-9[`F5bf`_`[9`#cite-note-9]`_`f] Iterative Viterbi decoding works by iteratively invoking a modified Viterbi algorithm, reestimating the score for a filler until convergence.

An alternative algorithm, the Lazy Viterbi algorithm, has been proposed.`:cite-ref-10[`F5bf`_`[10`#cite-note-10]`_`f] For many applications of practical interest, under reasonable noise conditions, the lazy decoder (using Lazy Viterbi algorithm) is much faster than the original `F33f`_`[Viterbi decoder`:/page/wikibook/entry.mu`zim=wikipedia_en_all_nopic_2025-08.zim|entry_path=Viterbi_decoder]`_`f (using Viterbi algorithm). While the original Viterbi algorithm calculates every node in the `F33f`_`[trellis`:/page/wikibook/entry.mu`zim=wikipedia_en_all_nopic_2025-08.zim|entry_path=Trellis_(graph)]`_`f of possible outcomes, the Lazy Viterbi algorithm maintains a prioritized list of nodes to evaluate in order, and the number of calculations required is typically fewer (and never more) than the ordinary Viterbi algorithm for the same result. However, it is not so easy to parallelize in hardware.

>>Soft output Viterbi algorithm

The `!soft output Viterbi algorithm`! (`!SOVA`!) is a variant of the classical Viterbi algorithm.

SOVA differs from the classical Viterbi algorithm in that it uses a modified path metric which takes into account the `F33f`_`[a priori probabilities`:/page/wikibook/entry.mu`zim=wikipedia_en_all_nopic_2025-08.zim|entry_path=A_priori_probability]`_`f of the input symbols, and produces a `*soft`* output indicating the `*reliability`* of the decision.

The first step in the SOVA is the selection of the survivor path, passing through one unique node at each time instant, `*t`*. Since each node has 2 branches converging at it (with one branch being chosen to form the `*Survivor Path`*, and the other being discarded), the difference in the branch metrics (or `*cost`*) between the chosen and discarded branches indicate the `*amount of error`* in the choice.

This `*cost`* is accumulated over the entire sliding window (usually equals `*at least`* five constraint lengths), to indicate the `*soft output`* measure of reliability of the `*hard bit decision`* of the Viterbi algorithm.

>>See also

• `F33f`_`[Expectation–maximization algorithm`:/page/wikibook/entry.mu`zim=wikipedia_en_all_nopic_2025-08.zim|entry_path=Expectation–maximization_algorithm]`_`f
• `F33f`_`[Baum–Welch algorithm`:/page/wikibook/entry.mu`zim=wikipedia_en_all_nopic_2025-08.zim|entry_path=Baum–Welch_algorithm]`_`f
• `F33f`_`[Forward-backward algorithm`:/page/wikibook/entry.mu`zim=wikipedia_en_all_nopic_2025-08.zim|entry_path=Forward-backward_algorithm]`_`f
• `F33f`_`[Forward algorithm`:/page/wikibook/entry.mu`zim=wikipedia_en_all_nopic_2025-08.zim|entry_path=Forward_algorithm]`_`f
• `F33f`_`[Error-correcting code`:/page/wikibook/entry.mu`zim=wikipedia_en_all_nopic_2025-08.zim|entry_path=Error-correcting_code]`_`f
• `F33f`_`[Viterbi decoder`:/page/wikibook/entry.mu`zim=wikipedia_en_all_nopic_2025-08.zim|entry_path=Viterbi_decoder]`_`f
• `F33f`_`[Hidden Markov model`:/page/wikibook/entry.mu`zim=wikipedia_en_all_nopic_2025-08.zim|entry_path=Hidden_Markov_model]`_`f
• `F33f`_`[Part-of-speech tagging`:/page/wikibook/entry.mu`zim=wikipedia_en_all_nopic_2025-08.zim|entry_path=Part-of-speech_tagging]`_`f
• `F33f`_`[A* search algorithm`:/page/wikibook/entry.mu`zim=wikipedia_en_all_nopic_2025-08.zim|entry_path=A*_search_algorithm]`_`f

>>References

`:cite-note-1`!1.`! `F0af`_`[↑`#cite-ref-1]`_`f Xavier Anguera et al., "Speaker Diarization: A Review of Recent Research" Archived 2016-05-12 at the `F33f`_`[Wayback Machine`:/page/wikibook/entry.mu`zim=wikipedia_en_all_nopic_2025-08.zim|entry_path=Wayback_Machine]`_`f, retrieved 19. August 2010, IEEE TASLP
`:cite-note-2`!2.`! `F0af`_`[↑`#cite-ref-2]`_`f 29 Apr 2005, G. David Forney Jr: The Viterbi Algorithm: A Personal History
`:cite-note-slp-3`!3.`! `F0af`_`[↑`#cite-ref-slp-3-0]`_`f `:citerefdaniel-jurafskyjames-h-martin`aDaniel Jurafsky; James H. Martin. `*Speech and Language Processing`*. Pearson Education International. p. 246.
`:cite-note-4`!4.`! `F0af`_`[↑`#cite-ref-4]`_`f `:citerefschmid2004`aSchmid, Helmut (2004). `*Efficient parsing of highly ambiguous context-free grammars with bit vectors`* (PDF). Proc. 20th Int'l Conf. on Computational Linguistics (COLING). `F33f`_`[doi`:/page/wikibook/entry.mu`zim=wikipedia_en_all_nopic_2025-08.zim|entry_path=Doi_(identifier)]`_`f:10.3115/1220355.1220379.
`:cite-note-5`!5.`! `F0af`_`[↑`#cite-ref-5]`_`f `:citerefkleinmanning2003`aKlein, Dan; Manning, Christopher D. (2003). `*A* parsing: fast exact Viterbi parse selection`* (PDF). Proc. 2003 Conf. of the North American Chapter of the Association for Computational Linguistics on Human Language Technology (NAACL). pp. 40–47. `F33f`_`[doi`:/page/wikibook/entry.mu`zim=wikipedia_en_all_nopic_2025-08.zim|entry_path=Doi_(identifier)]`_`f:10.3115/1073445.1073461.
`:cite-note-6`!6.`! `F0af`_`[↑`#cite-ref-6]`_`f `:citerefstankekellergunduzhayes2006`aStanke, M.; Keller, O.; Gunduz, I.; Hayes, A.; Waack, S.; Morgenstern, B. (2006). "AUGUSTUS: Ab initio prediction of alternative transcripts". `*Nucleic Acids Research`*. `!34`! (Web Server issue): W435 – W439. `F33f`_`[doi`:/page/wikibook/entry.mu`zim=wikipedia_en_all_nopic_2025-08.zim|entry_path=Doi_(identifier)]`_`f:10.1093/nar/gkl200. `F33f`_`[PMC`:/page/wikibook/entry.mu`zim=wikipedia_en_all_nopic_2025-08.zim|entry_path=PMC_(identifier)]`_`f 1538822. `F33f`_`[PMID`:/page/wikibook/entry.mu`zim=wikipedia_en_all_nopic_2025-08.zim|entry_path=PMID_(identifier)]`_`f 16845043.
`:cite-note-7`!7.`! `F0af`_`[↑`#cite-ref-7]`_`f `:citerefquach-t-farooq-m-1994`aQuach, T.; Farooq, M. (1994). "Maximum Likelihood Track Formation with the Viterbi Algorithm". `*Proceedings of 33rd IEEE Conference on Decision and Control`*. Vol. 1. pp. 271–276. `F33f`_`[doi`:/page/wikibook/entry.mu`zim=wikipedia_en_all_nopic_2025-08.zim|entry_path=Doi_(identifier)]`_`f:10.1109/CDC.1994.410918.`B100`F9d9{{cite conference}}`f`b: CS1 maint: multiple names: authors list (link)
`:cite-note-8`!8.`! `F0af`_`[↑`#cite-ref-8]`_`f Xing E, slide 11.
`:cite-note-9`!9.`! `F0af`_`[↑`#cite-ref-9]`_`f `:citerefqi-wanglei-weirodney-a-kennedy2002`aQi Wang; Lei Wei; Rodney A. Kennedy (2002). "Iterative Viterbi Decoding, Trellis Shaping, and Multilevel Structure for High-Rate Parity-Concatenated TCM". `*IEEE Transactions on Communications`*. `!50`!: 48–55. `F33f`_`[doi`:/page/wikibook/entry.mu`zim=wikipedia_en_all_nopic_2025-08.zim|entry_path=Doi_(identifier)]`_`f:10.1109/26.975743.
`:cite-note-10`!10.`! `F0af`_`[↑`#cite-ref-10]`_`f `*A fast maximum-likelihood decoder for convolutional codes`* (PDF). Vehicular Technology Conference. December 2002. pp. 371–375. `F33f`_`[doi`:/page/wikibook/entry.mu`zim=wikipedia_en_all_nopic_2025-08.zim|entry_path=Doi_(identifier)]`_`f:10.1109/VETECF.2002.1040367.

>>General references

• `:citerefviterbi-aj1967`aViterbi AJ (April 1967). "Error bounds for convolutional codes and an asymptotically optimum decoding algorithm". `*IEEE Transactions on Information Theory`*. `!13`! (2): 260–269. `F33f`_`[doi`:/page/wikibook/entry.mu`zim=wikipedia_en_all_nopic_2025-08.zim|entry_path=Doi_(identifier)]`_`f:10.1109/TIT.1967.1054010. (note: the Viterbi decoding algorithm is described in section IV.) Subscription required.
• `:citereffeldmanabou-faycalfrigo2002`aFeldman J, Abou-Faycal I, Frigo M (2002). "A fast maximum-likelihood decoder for convolutional codes". `*Proceedings IEEE 56th Vehicular Technology Conference`*. Vol. 1. pp. 371–375. `F33f`_`[CiteSeerX`:/page/wikibook/entry.mu`zim=wikipedia_en_all_nopic_2025-08.zim|entry_path=CiteSeerX_(identifier)]`_`f 10.1.1.114.1314. `F33f`_`[doi`:/page/wikibook/entry.mu`zim=wikipedia_en_all_nopic_2025-08.zim|entry_path=Doi_(identifier)]`_`f:10.1109/VETECF.2002.1040367. `F33f`_`[ISBN`:/page/wikibook/entry.mu`zim=wikipedia_en_all_nopic_2025-08.zim|entry_path=ISBN_(identifier)]`_`f 978-0-7803-7467-6. `F33f`_`[S2CID`:/page/wikibook/entry.mu`zim=wikipedia_en_all_nopic_2025-08.zim|entry_path=S2CID_(identifier)]`_`f 9783963.
• `:citerefforney-gd1973`aForney GD (March 1973). "The Viterbi algorithm". `*Proceedings of the IEEE`*. `!61`! (3): 268–278. `F33f`_`[doi`:/page/wikibook/entry.mu`zim=wikipedia_en_all_nopic_2025-08.zim|entry_path=Doi_(identifier)]`_`f:10.1109/PROC.1973.9030. Subscription required.
• `:citerefpressteukolskyvetterlingflannery2007`aPress, WH; Teukolsky, SA; Vetterling, WT; Flannery, BP (2007). "Section 16.2. Viterbi Decoding". `*Numerical Recipes: The Art of Scientific Computing`* (3rd ed.). New York: Cambridge University Press. `F33f`_`[ISBN`:/page/wikibook/entry.mu`zim=wikipedia_en_all_nopic_2025-08.zim|entry_path=ISBN_(identifier)]`_`f 978-0-521-88068-8. Archived from the original on 2011-08-11. Retrieved 2011-08-17.
• `:citerefrabiner-lr1989`aRabiner LR (February 1989). "A tutorial on hidden Markov models and selected applications in speech recognition". `*Proceedings of the IEEE`*. `!77`! (2): 257–286. `F33f`_`[CiteSeerX`:/page/wikibook/entry.mu`zim=wikipedia_en_all_nopic_2025-08.zim|entry_path=CiteSeerX_(identifier)]`_`f 10.1.1.381.3454. `F33f`_`[doi`:/page/wikibook/entry.mu`zim=wikipedia_en_all_nopic_2025-08.zim|entry_path=Doi_(identifier)]`_`f:10.1109/5.18626. `F33f`_`[S2CID`:/page/wikibook/entry.mu`zim=wikipedia_en_all_nopic_2025-08.zim|entry_path=S2CID_(identifier)]`_`f 13618539. (Describes the forward algorithm and Viterbi algorithm for HMMs).
• Shinghal, R. and `F33f`_`[Godfried T. Toussaint`:/page/wikibook/entry.mu`zim=wikipedia_en_all_nopic_2025-08.zim|entry_path=Godfried_Toussaint]`_`f, "Experiments in text recognition with the modified Viterbi algorithm," `*IEEE Transactions on Pattern Analysis and Machine Intelligence`*, Vol. PAMI-l, April 1979, pp. 184–193.
• Shinghal, R. and `F33f`_`[Godfried T. Toussaint`:/page/wikibook/entry.mu`zim=wikipedia_en_all_nopic_2025-08.zim|entry_path=Godfried_Toussaint]`_`f, "The sensitivity of the modified Viterbi algorithm to the source statistics," `*IEEE Transactions on Pattern Analysis and Machine Intelligence`*, vol. PAMI-2, March 1980, pp. 181–185.

>>External links

• Implementations in Java, F#, Clojure, C# on Wikibooks
• Tutorial on convolutional coding with viterbi decoding, by Chip Fleming
• A tutorial for a Hidden Markov Model toolkit (implemented in C) that contains a description of the Viterbi algorithm
• Viterbi algorithm by Dr. `F33f`_`[Andrew J. Viterbi`:/page/wikibook/entry.mu`zim=wikipedia_en_all_nopic_2025-08.zim|entry_path=Andrew_Viterbi]`_`f (scholarpedia.org).

>>>Implementations

• Mathematica has an implementation as part of its support for stochastic processes
• Susa signal processing framework provides the C++ implementation for `F33f`_`[Forward error correction`:/page/wikibook/entry.mu`zim=wikipedia_en_all_nopic_2025-08.zim|entry_path=Forward_error_correction]`_`f codes and channel equalization here.
• C++
• C#
• Java Archived 2014-05-04 at the `F33f`_`[Wayback Machine`:/page/wikibook/entry.mu`zim=wikipedia_en_all_nopic_2025-08.zim|entry_path=Wayback_Machine]`_`f
• Java 8
• Julia (HMMBase.jl)
• Perl
• Prolog Archived 2012-05-02 at the `F33f`_`[Wayback Machine`:/page/wikibook/entry.mu`zim=wikipedia_en_all_nopic_2025-08.zim|entry_path=Wayback_Machine]`_`f
• Haskell
• Go
• SFIHMM includes code for Viterbi decoding.

`c`F0af`_`[↑ Back to top`#top]`_`f`a